package com.hileto.inf.modules.user;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.PreparedStatementSetter;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hileto.inf.utils.spring.SpringJdbcProxy;

@Service
@Transactional
public class BBService {

	@Autowired
	private SpringJdbcProxy springJdbcProxy;

	public void update(){
		springJdbcProxy.getJdbcTemplate().update("insert into stu(name) values('"+UUID.randomUUID().toString()+"')",new PreparedStatementSetter(){
			@Override
			public void setValues(PreparedStatement arg0) throws SQLException {
				System.out.println("BBService : " + arg0.getConnection());
			}
		});
		
	}
}
